
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>MyBatis-Flex轻量高效的ORM框架 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>MyBatis-Flex轻量高效的ORM框架 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">MyBatis-Flex提供了哪些核心功能来提升开发效率和灵活性？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">MyBatis-Flex提供了五大核心功能：1. 强大的查询构造器，支持链式调用；2. 智能分页，自动处理COUNT查询；3. 多数据源支持；4. 代码生成功能，可自动生成实体类和Mapper；5. 支持XML、注解、API等多种查询方式。</div>
          </div>
          <div class="card-source">来源: 核心功能概述</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">与其他ORM框架相比，MyBatis-Flex的主要优势和特色是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">MyBatis-Flex的主要优势包括：低侵入性，与原生MyBatis完美兼容；精心优化带来的高性能；直观的API设计带来的低学习成本；以及拥有一个持续更新和问题响应及时的活跃社区。</div>
          </div>
          <div class="card-source">来源: 优势与特色</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在Spring Boot项目中集成MyBatis-Flex时，最核心的Maven依赖是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">最核心的依赖是`mybatis-flex-spring-boot-starter`。它提供了MyBatis-Flex与Spring Boot自动集成的所有功能。</div>
          </div>
          <div class="card-source">来源: MyBatis-Flex与Spring Boot整合 - 1. 添加依赖</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">如何使用注解将一个Java实体类映射到数据库表，并指定一个自增主键？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">使用`@Table("表名")`注解在类上，将实体类映射到指定的数据库表。使用`@Id(keyType = KeyType.AUTO)`注解在字段上，将其声明为自增主键。</div>
          </div>
          <div class="card-source">来源: MyBatis-Flex与Spring Boot整合 - 3. 创建实体类</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在MyBatis-Flex中，让Mapper接口继承`BaseMapper<T>`有什么作用？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Mapper接口继承`BaseMapper<T>`后，会自动获得一系列预定义的增、删、改、查方法，开发者无需再手动编写这些基础的CRUD操作，从而简化了代码。</div>
          </div>
          <div class="card-source">来源: MyBatis-Flex与Spring Boot整合 - 4. 创建Mapper接口</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">如何使用MyBatis-Flex的`QueryWrapper`构建一个带条件的动态查询？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">通过静态方法`QueryWrapper.create()`创建一个实例，然后使用`.where()`、`.and()`等方法进行链式调用来构建查询条件。例如：`QueryWrapper.create().where(USER.USERNAME.like(username + "%')).and(USER.AGE.ge(minAge))`。</div>
          </div>
          <div class="card-source">来源: MyBatis-Flex与Spring Boot整合 - 6. 创建Controller实现CRUD操作</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在Spring Boot应用中，为了让MyBatis-Flex能够找到并注册Mapper接口，需要在启动类上添加什么注解？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">需要在Spring Boot的启动类上添加`@MapperScan`注解，并指定Mapper接口所在的包路径，例如`@MapperScan("com.yourpackage.mapper")`。</div>
          </div>
          <div class="card-source">来源: MyBatis-Flex与Spring Boot整合 - 7. 启动应用</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">MyBatis-Flex的“智能分页”特性是如何简化分页查询开发的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">它的“智能分页”特性能够自动处理分页逻辑，开发者在进行分页查询时无需再手写一个单独的`COUNT`查询来获取总记录数，从而简化了开发工作。</div>
          </div>
          <div class="card-source">来源: 核心功能概述</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">在Spring Boot的`application.yml`文件中，如何配置MyBatis-Flex来开启SQL日志打印？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在`mybatis-flex.configuration`配置项下，设置`log-impl`属性的值为`org.apache.ibatis.logging.stdout.StdOutImpl`即可开启SQL日志打印到控制台。</div>
          </div>
          <div class="card-source">来源: MyBatis-Flex与Spring Boot整合 - 2. 配置数据源</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
